<include file="./Tpl/Home/Header.html"/>
<script type="text/javascript" charset="utf-8" async="" src="__PUBLIC__/factory/alert.js"></script>

<style type="text/css">
.buttonGreen2 {
background: none repeat scroll 0 0 #068814;
color: white;
display: inline-block;
font-size: 14px;
font-weight: 700;
height: 32px;
line-height: 32px;
margin-top: 5px;
margin-bottom: 5px;
text-align: center;
width: 100px;
}
</style>
<style type="text/css">
.buybtc-subscription {
    float: left;
    height: 290px;
    width: 777px;
}
.buybtc-subscription2 {
    float: left;
    height: 330px;
    width: 777px;
}
.buybtcbody-subscription {
    height: 242px;
}
</style>
<div class="marketArea clear">
	<include file="./Tpl/Home/Left.html"/>
	<div class="rightArea">
		<div class="buysellTitle">
              	<div class="selecttab1">
				<ul class="selecttab-box1">
					<foreach name='qishu' item='v' key='k'>
						<li <eq name="id" value="$v['id']"> class="cur"</eq> >
							<a href="/?s=Home/Kuang/index/id/{$v.id}" class="otherBoxTitle">{$biname}(第{$k+1}期)抢购（认购点我）</a>
						</li>
					</foreach>
					
				</ul>
			</div>					
		</div>
	 
		<div class="rightArea3">
		<div class="riskArea">
			<span class="icon"></span>
			<span class="hinttext">
			<span class="define">认购简介</span>
			<span> {$issue.info|default='...'} 
			</span>
			</span>
		</div>
		</div>
			   
		     <div style="margin-top: 3px;" class="entrustTen lasttenorder">
			<div class="Tentitle">
		
 		     <!--<span class="lightblue4" style="padding-bottom:20px;display:block;">拍{$sys.ksname}区
			 <span>(您累计{$sys.ksname}总量：<font color="red">{$sum}</font>个，今日产量：<font color="red">{$todaysum}</font>个)</span>
 		     </span>-->
			 <!--<input type="button" id="iskuang" value="<eq name='auth.iskuang' value='0'>开始<else/>停止</eq>拍{$sys.ksname}" style="padding:10px 20px;margin-bottom:20px;background:#FB8510;color:#fff;"/>-->
			 <script language="javascript">
			 $(document).ready(function(){
				 var iskuang = '{$auth.iskuang}';
			     $('#iskuang').click(function(){

                     var isopen = '{$sys.kuangopen}';
					 if(isopen=='0'){
					     alert('现在还没开始！');
						 return false;
					 }

				     $.post('{$path}/Kuang/mining',{iskuang:iskuang},function(d){
					     if(d.status==0){
						     iskuang=d.data;
							 if(d.data==1)
						         $('#iskuang').val('停止拍{$sys.ksname}');
						     else
							     $('#iskuang').val('开始拍{$sys.ksname}');
						 }
					 },'json');
				 });
				 $(".items4").parent("li").addClass("cur");
				 $(".bor").eq(0).children("div").addClass("tradeTitlecur").removeClass("tradeTitle");
				$(".bor").eq(0).find("span").addClass("trade1cur").removeClass("trade1");
			 });
			 </script>
			</div>
			 
	 </div>
		<eq name="issue.status" value="0">
		  <div style="margin-top: -30px;" class="entrustTen lasttenorder">
			<div class="Tentitle">
 		     <span class="lightblue4">购买{$biname}</span>
			</div>
			  <div class="coinBoxBody">
					<table width="100%" style="background:#fff;">
						<tbody>
						 <tr>
						     <!--<td style="padding:20px 0px;"><img src="/Public/Home/kg.jpg" height="300"/></td>-->
						    <style>
                            	.coinBoxBody ul li{ margin-bottom:20px; font-size:14px}
								.coinBoxBody ul li input{ height:35px;}
								.coinBoxBody ul li span{ margin-left:40px}
                            </style>
							 <td style="padding:20px 0px;text-align:left;line-height:27px;width:450px;position:relative;left:50px;">
							     <h2>{$biname}认购</h2>
                                 <ul>
								 <li>总量：<span>{$issue.num}个</span></li>
								 <li>剩余：<span>{$issue.cur}个</span></li>
								 <li>限购：<span>{$issue.limit}个</span></li>
								 <li>已购：<span>{$buynum}个</span></li>
								 <li>价格：<span>￥{$issue.price}</span></li>
								 <li>购买数量：<input type="text" id="num"/> 个 <span id="numdes"></span></li>
								 <li>支付密码：<input type="password" id="paypwd"/> <a href="{$path}/User/lostpwd">忘记密码？</a> <span id="paypwddes"></span></li>
								 <li><a class="buttonGreen2" style="width:220px;" id="btnA">买入</a></li>
                                 </ul>
							 </td>
						 </tr>
			            </tbody>
			        </table>
			</div>
		</div>
		</eq>
		<eq name="issue.status" value="-1">
		
				<div class="rightArea1">
				<div class="coinBox buybtc-subscription">
				<div class="coinBoxTitle">
	           <input type="hidden" value="1" id="isopen">
	           <input type="hidden" value="" id="symbol">
		
	           <span>抢购时间：{$issue.add_time|date="Y-m-d",###}~{$issue.end_time|date="Y-m-d",###}
	           (抢购即将开始)
	           
	           
	           </span>
				</div>
					<div class="coinBoxBody buybtcbody-subscription">
						
							
							
								<br><br><br>
								<div class="submitorder"><a class="buttonGreen">抢购即将开始</a></div>
							
							
						
					</div>
		
			</div>
			</div>
		</eq>
		<eq name="issue.status" value="1">
		<div class="rightArea1">
				<div class="coinBox buybtc-subscription">
				<div class="coinBoxTitle">
	           <input type="hidden" value="1" id="isopen">
	           <input type="hidden" value="" id="symbol">
		
	           <span>抢购时间：2015-12-30 00:00~2016-01-30 00:00
	           (抢购已经结束)
	           
	           
	           </span>
				</div>
					<div class="coinBoxBody buybtcbody-subscription">
						
							
							
								<br><br><br>
								<div class="submitorder"><a class="buttonGreen">抢购已经结束</a></div>
							
							
						
					</div>
		
			</div>
			</div>
		</eq>
<script type="text/javascript" src="/Public/js/formcheck.js"></script>
<script language="javascript">
$(document).ready(function(){
    $('#num').blur(function(){
	    chkStr($('#num'),$('#numdes'),'请输入购买数量');
	});

    $('#num').focus(function(){
	    recover($('#num'),$('#numdes'));
	});

	$('#paypwd').blur(function(){
	    checkpwd($('#paypwd'),$('#paypwddes'));
	});

    $('#paypwd').focus(function(){
	    recover($('#paypwd'),$('#paypwddes'));
	});

	$('#btnA').click(function(){
		var n = chkStr($('#num'),$('#numdes'),'请输入购买数量');
		var p = checkpwd($('#paypwd'),$('#paypwddes'));
		var iid = "{$issue.id}";

		if(n && p){
			$.post('{$path}/Buy/insert',{num:$('#num').val(),paypwd:$('#paypwd').val(),iid:iid},function(d){
				alert(d.info);
				location.reload()
			},'json');
		}
	});
});
</script>

	<div style="margin-top: 3px;" class="entrustTen lasttenorder">
		<div class="Tentitle">

			<span class="lightblue4">认购记录</span>
		</div>
		<div class="coinBoxBody">
			<table width="100%">
				<tbody>
					<tr>
							<th width="190">抢购数量</th>
							<th width="200">抢购价格</th>
							<th width="200">总价格</th>
							<th width="180">抢购时间</th>
						</tr>
					<volist name="log" id="vo" empty="$empty">
					<tr>
                    <td>{$vo.num}</td>
                     <td>{$vo.price}</td>
                     <td>{$vo['price']*$vo['num']}</td>
                    <td>{$vo.ctime|date="Y-m-d H:i:s",###}</td></tr>
					</volist>
				</tbody>
			</table>
		</div>

		<div class="page">
			<ul>
			<li><a href="{$path}/Kuang/index/page/1">首页</a></li>
			<li><a href="{$path}/Kuang/index/page/{$page-1}">上一页</a></li>
			<li><a href="{$path}/Kuang/index/page/{$page+1}">下一页</a></li>
			<li><a href="{$path}/Kuang/index/page/{$page_num}">尾页</a></li>
			</ul>
		</div>
	</div>
	 
</div>
</div>
<include file="./Tpl/Home/Footer.html" />